/*
 Navicat Premium Data Transfer

 Source Server         : WORKORDER
 Source Server Type    : Oracle
 Source Server Version : 120200
 Source Host           : 121.4.197.103:1521
 Source Schema         : WORKORDER

 Target Server Type    : Oracle
 Target Server Version : 120200
 File Encoding         : 65001

 Date: 07/02/2021 16:22:47
*/


-- ----------------------------
-- Table structure for CUSTOM_FIELD
-- ----------------------------
DROP TABLE WORKORDER.CUSTOM_FIELD;
CREATE TABLE WORKORDER.CUSTOM_FIELD (
  ID NUMBER(20) VISIBLE DEFAULT WORKORDER.ISEQ$$_76802.nextval   NOT NULL ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  TYPE VARCHAR2(64 BYTE) VISIBLE ,
  SOURCE NUMBER VISIBLE ,
  CREATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_TIME TIMESTAMP(6) VISIBLE ,
  LAST_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_UPDATE_TIME TIMESTAMP(6) VISIBLE ,
  USE_STATUS NUMBER VISIBLE ,
  CONTENT CLOB VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  CODE VARCHAR2(64 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for CUSTOM_FIELD_DATA_SOURCE
-- ----------------------------
DROP TABLE WORKORDER.CUSTOM_FIELD_DATA_SOURCE;
CREATE TABLE WORKORDER.CUSTOM_FIELD_DATA_SOURCE (
  ID VARCHAR2(32 BYTE) VISIBLE ,
  FIELD_NAME VARCHAR2(64 BYTE) VISIBLE ,
  DATA_CONTENT CLOB VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.CUSTOM_FIELD_DATA_SOURCE.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.CUSTOM_FIELD_DATA_SOURCE.FIELD_NAME IS '字段名称';
COMMENT ON COLUMN WORKORDER.CUSTOM_FIELD_DATA_SOURCE.DATA_CONTENT IS '数据源内容';

-- ----------------------------
-- Table structure for EWS_DEPARTMENT
-- ----------------------------
DROP TABLE WORKORDER.EWS_DEPARTMENT;
CREATE TABLE WORKORDER.EWS_DEPARTMENT (
  ID VARCHAR2(64 BYTE) VISIBLE NOT NULL ,
  PID VARCHAR2(64 BYTE) VISIBLE ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  DEPT_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76810.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.EWS_DEPARTMENT.ID IS '部门id';
COMMENT ON COLUMN WORKORDER.EWS_DEPARTMENT.PID IS '父部门id';
COMMENT ON COLUMN WORKORDER.EWS_DEPARTMENT.NAME IS '部门名称';
COMMENT ON COLUMN WORKORDER.EWS_DEPARTMENT.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.EWS_DEPARTMENT.DEPT_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for EWS_ROLE
-- ----------------------------
DROP TABLE WORKORDER.EWS_ROLE;
CREATE TABLE WORKORDER.EWS_ROLE (
  ID VARCHAR2(64 BYTE) VISIBLE NOT NULL ,
  CODE VARCHAR2(64 BYTE) VISIBLE ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  ROLE_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76813.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.EWS_ROLE.ID IS '角色id';
COMMENT ON COLUMN WORKORDER.EWS_ROLE.CODE IS '角色编号';
COMMENT ON COLUMN WORKORDER.EWS_ROLE.NAME IS '角色名';
COMMENT ON COLUMN WORKORDER.EWS_ROLE.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.EWS_ROLE.ROLE_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for EWS_USER
-- ----------------------------
DROP TABLE WORKORDER.EWS_USER;
CREATE TABLE WORKORDER.EWS_USER (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  CODE VARCHAR2(64 BYTE) VISIBLE ,
  USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  DEPARTMENT_ID VARCHAR2(64 BYTE) VISIBLE ,
  IS_LEADER VARCHAR2(8 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  PHONE VARCHAR2(64 BYTE) VISIBLE ,
  USER_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76816.nextval   NOT NULL ,
  EMAIL VARCHAR2(64 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.EWS_USER.ID IS '用户id';
COMMENT ON COLUMN WORKORDER.EWS_USER.NAME IS '用户名称';
COMMENT ON COLUMN WORKORDER.EWS_USER.CODE IS '用户编号';
COMMENT ON COLUMN WORKORDER.EWS_USER.USER_NAME IS '用户名';
COMMENT ON COLUMN WORKORDER.EWS_USER.DEPARTMENT_ID IS '部门id';
COMMENT ON COLUMN WORKORDER.EWS_USER.IS_LEADER IS '是否为部门负责人Y是N否';
COMMENT ON COLUMN WORKORDER.EWS_USER.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.EWS_USER.PHONE IS '用户电话';
COMMENT ON COLUMN WORKORDER.EWS_USER.USER_PRIMARY_ID IS '主键id';
COMMENT ON COLUMN WORKORDER.EWS_USER.EMAIL IS '邮箱';

-- ----------------------------
-- Table structure for EWS_USER_ROLE
-- ----------------------------
DROP TABLE WORKORDER.EWS_USER_ROLE;
CREATE TABLE WORKORDER.EWS_USER_ROLE (
  USERID VARCHAR2(64 BYTE) VISIBLE ,
  ROLEID VARCHAR2(64 BYTE) VISIBLE ,
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76823.nextval   NOT NULL ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for EXTERNAL_FLOW_INFO
-- ----------------------------
DROP TABLE WORKORDER.EXTERNAL_FLOW_INFO;
CREATE TABLE WORKORDER.EXTERNAL_FLOW_INFO (
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76826.nextval   NOT NULL ,
  EXTERNAL_FLOW_WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  EXTERNAL_FLOW_INFO CLOB VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.EXTERNAL_FLOW_INFO.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.EXTERNAL_FLOW_INFO.EXTERNAL_FLOW_WORK_ORDER_ID IS '外部流转工单id';
COMMENT ON COLUMN WORKORDER.EXTERNAL_FLOW_INFO.EXTERNAL_FLOW_INFO IS '外部流转信息';

-- ----------------------------
-- Table structure for FILTER_FIRST
-- ----------------------------
DROP TABLE WORKORDER.FILTER_FIRST;
CREATE TABLE WORKORDER.FILTER_FIRST (
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76831.nextval   NOT NULL ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  FILTER_SECOND_ID NUMBER(11) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  RELATION_FIELD_CODE VARCHAR2(64 BYTE) VISIBLE ,
  BELONG_TO_TABLE VARCHAR2(64 BYTE) VISIBLE ,
  STATUS VARCHAR2(8 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.FILTER_FIRST.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.FILTER_FIRST.NAME IS '一级过滤名称';
COMMENT ON COLUMN WORKORDER.FILTER_FIRST.FILTER_SECOND_ID IS '二级过滤id';
COMMENT ON COLUMN WORKORDER.FILTER_FIRST.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.FILTER_FIRST.RELATION_FIELD_CODE IS '关联查询字段编码';
COMMENT ON COLUMN WORKORDER.FILTER_FIRST.BELONG_TO_TABLE IS '关联查询的字段所属的数据库表';
COMMENT ON COLUMN WORKORDER.FILTER_FIRST.STATUS IS '状态（0启用1停用）';

-- ----------------------------
-- Records of FILTER_FIRST
-- ----------------------------
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('1', '工单标题', '1', 'sys', 'title', 'work_order', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('2', '工单描述', '1', 'sys', 'problem_desc', 'work_order', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('3', '客户名称', '1', 'sys', 'client_name', 'work_order', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('4', '客户电话', '1', 'sys', 'phone', 'work_order', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('5', '工单状态', '2', 'sys', 'status_id', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('6', '工单优先级', '2', 'sys', 'priority', 'work_order', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('7', '工单来源', '2', 'sys', 'source', 'work_order', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('8', '工单节点', '2', 'sys', 'current_work_order_node_id', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('9', '工单创建人', '3', 'sys', 'create_user_id', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('10', '工单当前受理人', '3', 'sys', 'current_handler_id', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('11', '工单历史受理人', '3', 'sys', 'history_handler_id', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('12', '工单发起时间', '4', 'sys', 'create_time', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('13', '工单完成时间', '4', 'sys', 'close_time', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('14', '工单催单次数', '5', 'sys', 'urge_count', 'work_order_relation', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('15', '工单创建后时长', '6', 'sys', 'create_time', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('16', '工单关闭后时长', '6', 'sys', 'close_time', 'work_order', '0');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('17', '拨打状态', '2', 'sys', 'call_state', 'work_order_relation', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('18', '催办状态', '2', 'sys', 'urge_state', 'work_order_relation', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('19', '已关注', '1', 'sys', 'work_order_monitor_id', 'work_order_relation', '1');
INSERT INTO WORKORDER.FILTER_FIRST VALUES ('20', '超时', '1', 'sys', 'is_time_out', 'work_order_relation', '0');

-- ----------------------------
-- Table structure for FILTER_SECOND
-- ----------------------------
DROP TABLE WORKORDER.FILTER_SECOND;
CREATE TABLE WORKORDER.FILTER_SECOND (
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_84884.nextval   NOT NULL ,
  CONTENT CLOB VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Records of FILTER_SECOND
-- ----------------------------
INSERT INTO WORKORDER.FILTER_SECOND VALUES ('1', '{data: [{id: 1, name: 包含}, {id: 2, name: 不包含}]}', 'sys');
INSERT INTO WORKORDER.FILTER_SECOND VALUES ('2', '{data: [{id: 1, name: 是}, {id: 2, name: 不是}, {id: 3, name: 包含任意}, {id: 4, name: 不包含任意}]}', 'sys');
INSERT INTO WORKORDER.FILTER_SECOND VALUES ('3', '{data: [{id: 1, name: 是}, {id: 2, name: 不是}, {id: 3, name: 包含任意}, {id: 4, name: 不包含任意}], type: [{id: user, name: 用户}, {id: role, name: 角色}, {id: dept, name: 部门}]}', 'sys');
INSERT INTO WORKORDER.FILTER_SECOND VALUES ('4', '{data: [{id: 1, name: 早于}, {id: 2, name: 晚于}, {id: 3, name: 介于}]}', 'sys');
INSERT INTO WORKORDER.FILTER_SECOND VALUES ('5', '{data: [{id: 1, name: 等于}, {id: 2, name: 大于}, {id: 3, name: 小于}]}', 'sys');
INSERT INTO WORKORDER.FILTER_SECOND VALUES ('6', '{data: [{id: 1, name: 大于}, {id: 2, name: 小于}, {id: 3, name: 介于}]}', 'sys');

-- ----------------------------
-- Table structure for FORM_TEMPLATE
-- ----------------------------
DROP TABLE WORKORDER.FORM_TEMPLATE;
CREATE TABLE WORKORDER.FORM_TEMPLATE (
  ID NUMBER(20) VISIBLE DEFAULT WORKORDER.ISEQ$$_76840.nextval   NOT NULL ,
  NAME VARCHAR2(128 BYTE) VISIBLE ,
  CREATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_TIME TIMESTAMP(6) VISIBLE ,
  LAST_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_UPDATE_TIME TIMESTAMP(6) VISIBLE ,
  USE_STATUS NUMBER(11) VISIBLE ,
  CONTENT CLOB VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  USED_CUSTOM_FIELD_IDS VARCHAR2(255 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.ID IS '模板id';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.NAME IS '模板名称';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.CREATE_USER_ID IS '创建人id';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.CREATE_USER_NAME IS '创建人名';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.LAST_USER_ID IS '更新人id';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.LAST_USER_NAME IS '更新人名';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.LAST_UPDATE_TIME IS '更新时间';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.USE_STATUS IS '模板被使用的次数，大于0时不能删除';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.CONTENT IS '模板内容';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.FORM_TEMPLATE.USED_CUSTOM_FIELD_IDS IS '模板中使用的自定义字段id';

-- ----------------------------
-- Records of FORM_TEMPLATE
-- ----------------------------
INSERT INTO WORKORDER.FORM_TEMPLATE VALUES ('2', '我的模板', 'zhaojie', 'zhaojie姓名', TO_TIMESTAMP('2021-02-05 10:34:42.256000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'zhaojie', 'zhaojie姓名', TO_TIMESTAMP('2021-02-05 10:34:42.256000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '{list:[{type:input,icon:icon-input,options:{width:100%,defaultValue:,required:false,dataType:string,pattern:,placeholder:,customClass:,disabled:false,labelWidth:100,isLabelWidth:false,hidden:false,dataBind:true,showPassword:false,remoteOption:option_1612492480482,remoteFunc:func_1612492480482},name:单行文本,dataSign:,id:24,useStatus:null,key:1612492480482,model:input_1612492480482,rules:[{type:string,message:单行文本格式不正确}]}],config:{labelWidth:100,labelPosition:right,size:small,customClass:}}', 'default', '24');

-- ----------------------------
-- Table structure for MSG_NOTIFY_SETTING
-- ----------------------------
DROP TABLE WORKORDER.MSG_NOTIFY_SETTING;
CREATE TABLE WORKORDER.MSG_NOTIFY_SETTING (
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76845.nextval   NOT NULL ,
  WORK_ORDER_TYPE_ID NUMBER(20) VISIBLE ,
  NOTIFY_TYPE VARCHAR2(64 BYTE) VISIBLE ,
  STATUS NUMBER(4) VISIBLE ,
  CREATE_TIME DATE VISIBLE ,
  CREATOR VARCHAR2(64 BYTE) VISIBLE ,
  UPDATE_TIME DATE VISIBLE ,
  UPDATER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.ID IS '主键';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.WORK_ORDER_TYPE_ID IS '工单类型id';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.NOTIFY_TYPE IS '通知类型（例：催单）';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.STATUS IS '0停用，1启用';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.CREATOR IS '创建人';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.UPDATE_TIME IS '更新时间';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.UPDATER_NAME IS '更新人';
COMMENT ON COLUMN WORKORDER.MSG_NOTIFY_SETTING.TENANT_ID IS '租户';

-- ----------------------------
-- Records of MSG_NOTIFY_SETTING
-- ----------------------------
INSERT INTO WORKORDER.MSG_NOTIFY_SETTING VALUES ('1', '1612510001333', 'flow_notify', '1', TO_DATE('2021-02-05 18:51:49', 'SYYYY-MM-DD HH24:MI:SS'), 'zhaojie', TO_DATE('2021-02-05 18:51:49', 'SYYYY-MM-DD HH24:MI:SS'), 'zhaojie', 'default');

-- ----------------------------
-- Table structure for MSG_SETTING_RELATION
-- ----------------------------
DROP TABLE WORKORDER.MSG_SETTING_RELATION;
CREATE TABLE WORKORDER.MSG_SETTING_RELATION (
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76848.nextval   NOT NULL ,
  MSG_NOTIFY_ID NUMBER(11) VISIBLE ,
  MSG_TARGET_TYPE VARCHAR2(32 BYTE) VISIBLE ,
  MSG_TYPE VARCHAR2(32 BYTE) VISIBLE ,
  MSG_TEMPLATE_ID NUMBER(11) VISIBLE ,
  TENANT_ID VARCHAR2(32 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.MSG_SETTING_RELATION.ID IS '主键';
COMMENT ON COLUMN WORKORDER.MSG_SETTING_RELATION.MSG_NOTIFY_ID IS '消息通知id';
COMMENT ON COLUMN WORKORDER.MSG_SETTING_RELATION.MSG_TARGET_TYPE IS '消息接收人类型（创建人，处理人）';
COMMENT ON COLUMN WORKORDER.MSG_SETTING_RELATION.MSG_TYPE IS '消息类型';
COMMENT ON COLUMN WORKORDER.MSG_SETTING_RELATION.MSG_TEMPLATE_ID IS '消息模板id';
COMMENT ON COLUMN WORKORDER.MSG_SETTING_RELATION.TENANT_ID IS '租户';

-- ----------------------------
-- Table structure for MSG_TEMPLATE
-- ----------------------------
DROP TABLE WORKORDER.MSG_TEMPLATE;
CREATE TABLE WORKORDER.MSG_TEMPLATE (
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76851.nextval   NOT NULL ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  STATUS NUMBER(4) VISIBLE ,
  CREATE_TIME DATE VISIBLE ,
  CREATOR VARCHAR2(64 BYTE) VISIBLE ,
  UPDATER_NAME VARCHAR2(32 BYTE) VISIBLE ,
  TEMPLATE_TYPE VARCHAR2(64 BYTE) VISIBLE ,
  UPDATE_TIME DATE VISIBLE ,
  DISCRIPTION VARCHAR2(255 BYTE) VISIBLE ,
  CONTENT VARCHAR2(255 BYTE) VISIBLE ,
  ATTACHMENT_ADDRESS CLOB VISIBLE ,
  LINK_TO_WORK_ORDER VARCHAR2(4 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(32 BYTE) VISIBLE ,
  TITLE VARCHAR2(255 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.ID IS '主键';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.NAME IS '模板名称';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.STATUS IS '启用状态 0停用，1启用';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.CREATOR IS '创建人';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.UPDATER_NAME IS '更新人';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.TEMPLATE_TYPE IS '模板类型，msg短信，sysMsg系统消息，email邮件';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.UPDATE_TIME IS '修改时间';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.DISCRIPTION IS '描述';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.CONTENT IS '模板内容';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.ATTACHMENT_ADDRESS IS '附件地址';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.LINK_TO_WORK_ORDER IS '是否跳转到工单详情，Y是，N否';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.TENANT_ID IS '租户';
COMMENT ON COLUMN WORKORDER.MSG_TEMPLATE.TITLE IS '标题';

-- ----------------------------
-- Records of MSG_TEMPLATE
-- ----------------------------
INSERT INTO WORKORDER.MSG_TEMPLATE VALUES ('1', '我的模板', '1', TO_DATE('2021-02-05 18:33:17', 'SYYYY-MM-DD HH24:MI:SS'), 'zhaojie', 'zhaojie', 'sys_msg', TO_DATE('2021-02-05 18:33:17', 'SYYYY-MM-DD HH24:MI:SS'), NULL, '模板内容', '[]', 'N', 'default', NULL);

-- ----------------------------
-- Table structure for SYS_DICT
-- ----------------------------
DROP TABLE WORKORDER.SYS_DICT;
CREATE TABLE WORKORDER.SYS_DICT (
  ID VARCHAR2(64 BYTE) VISIBLE NOT NULL ,
  PID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_TIME DATE VISIBLE ,
  UPDATE_TIME DATE VISIBLE ,
  DICT_CODE VARCHAR2(64 BYTE) VISIBLE ,
  DICT_NAME VARCHAR2(128 BYTE) VISIBLE ,
  STATUS VARCHAR2(8 BYTE) VISIBLE ,
  DELETED VARCHAR2(8 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  DICT_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76856.nextval   NOT NULL ,
  IS_SYS VARCHAR2(8 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.SYS_DICT.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.SYS_DICT.PID IS '父id';
COMMENT ON COLUMN WORKORDER.SYS_DICT.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.SYS_DICT.UPDATE_TIME IS '修改时间';
COMMENT ON COLUMN WORKORDER.SYS_DICT.DICT_CODE IS '字典编码';
COMMENT ON COLUMN WORKORDER.SYS_DICT.DICT_NAME IS '字典名称';
COMMENT ON COLUMN WORKORDER.SYS_DICT.STATUS IS '状态（0启用1停用）';
COMMENT ON COLUMN WORKORDER.SYS_DICT.DELETED IS '删除状态（0正常1删除）';
COMMENT ON COLUMN WORKORDER.SYS_DICT.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.SYS_DICT.DICT_PRIMARY_ID IS '主键id';
COMMENT ON COLUMN WORKORDER.SYS_DICT.IS_SYS IS '是否系统字段Y是N否';

-- ----------------------------
-- Records of SYS_DICT
-- ----------------------------
INSERT INTO WORKORDER.SYS_DICT VALUES ('1', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'trigger_action_type', '触发器执行类型', '0', '0', 'sys', '25', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('10', '9', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'work_order_pool', '工单池', '0', '0', 'sys', '26', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('11', '9', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'receive_way', '领取方式', '0', '0', 'sys', '27', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('12', '9', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'sequence_distribution', '依次分配', '0', '0', 'sys', '28', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('13', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'push_msg_monitor', '系统消息：给工单关注人', '0', '0', 'sys', '29', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('14', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'send_msg_employee', '发短信：给员工', '0', '0', 'sys', '30', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('15', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'send_msg_customer', '发短信：给客户', '0', '0', 'sys', '31', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('16', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'send_msg_creator', '发短信：给创建人', '0', '0', 'sys', '32', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('17', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'send_msg_current_handler', '发短信：给当前处理人', '0', '0', 'sys', '33', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('18', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'button_permissions', '按钮权限', '0', '0', 'sys', '34', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('19', '18', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'order_withdraw', '工单撤回', '0', '0', 'sys', '35', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('2', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'set_status', '工单：设置状态', '0', '0', 'sys', '36', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('20', '18', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'sub_order_view', '子工单展示', '0', '0', 'sys', '37', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('21', '18', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'smart_fill_form', '智能录单', '0', '0', 'sys', '38', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('22', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'order_detail_attribute_view', '工单详情属性展示', '0', '0', 'sys', '39', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('23', '22', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'work_order_monitor_id', '展示工单关注人', '0', '0', 'sys', '40', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('24', '22', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'sender', '展示工单抄送人', '1', '0', 'sys', '41', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('25', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'send_msg_sender', '发短信：给抄送人', '0', '0', 'sys', '42', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('26', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'push_msg_sender', '系统消息：给抄送人', '0', '0', 'sys', '43', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('3', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'set_priority', '工单：设置优先级', '0', '0', 'sys', '44', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('4', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'set_handler', '工单：设置处理人', '0', '0', 'sys', '45', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('5', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'push_msg_creater', '系统消息：给创建人', '0', '0', 'sys', '46', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('6', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'push_msg_handler', '系统消息：给当前处理人', '0', '0', 'sys', '47', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('7', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'push_msg_sysuser', '系统消息：选择系统用户', '0', '0', 'sys', '48', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('8', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'push_interface', '推送：接口', '0', '0', 'sys', '49', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('9', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'distribution_way', '分配方式', '0', '0', 'sys', '50', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('27', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'msg_type', '消息类型', '0', '0', 'sys', '51', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('28', '27', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'msg', '短信', '0', '0', 'sys', '52', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('29', '27', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'sys_msg', '系统消息', '0', '0', 'sys', '53', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('30', '27', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'email', '邮件', '0', '0', 'sys', '54', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('31', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'msg_notify_target', '消息通知对象', '0', '0', 'sys', '55', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('32', '31', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'creator', '创建人', '0', '0', 'sys', '56', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('33', '31', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'handler', '处理人', '0', '0', 'sys', '57', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('34', '31', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'Cc', '抄送人', '0', '0', 'sys', '58', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('35', '31', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'monitor', '关注人', '0', '0', 'sys', '59', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('36', '31', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'customer', '客户', '1', '1', 'sys', '60', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('37', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'msg_notify_type', '消息通知类型', '0', '0', 'sys', '61', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('38', '37', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'flow_notify', '流转通知', '0', '0', 'sys', '62', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('39', '37', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'time_out_notify', '超时通知', '0', '0', 'sys', '63', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('40', '37', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'urge_notify', '催单通知', '0', '0', 'sys', '64', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('41', '37', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'accepted_notify', '受理通知', '1', '1', 'sys', '65', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('42', '37', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'complete_notify', '结案通知', '1', '1', 'sys', '66', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('43', NULL, TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'msg_template_param', '消息模板参数', '0', '0', 'sys', '67', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('44', '43', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'WORKORDERId', '工单编号', '0', '0', 'sys', '68', 'Y');
INSERT INTO WORKORDER.SYS_DICT VALUES ('45', '1', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'send_email_creater', '发邮件：给处理人', '0', '0', 'sys', '69', NULL);
INSERT INTO WORKORDER.SYS_DICT VALUES ('46', '43', TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), TO_DATE('2020-02-26 11:07:25', 'SYYYY-MM-DD HH24:MI:SS'), 'backNodeHandler', '上一节点处理人', '0', '0', 'sys', '70', 'Y');

-- ----------------------------
-- Table structure for TASK_FORM
-- ----------------------------
DROP TABLE WORKORDER.TASK_FORM;
CREATE TABLE WORKORDER.TASK_FORM (
  TASK_ID VARCHAR2(64 BYTE) VISIBLE ,
  PROCESS_INSTANCE_ID VARCHAR2(64 BYTE) VISIBLE ,
  HANDLER_ID VARCHAR2(64 BYTE) VISIBLE ,
  HANDLER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  NODE_ID NUMBER(20) VISIBLE ,
  NODE_NAME VARCHAR2(128 BYTE) VISIBLE ,
  SUBMIT_TIME TIMESTAMP(6) VISIBLE ,
  CONTENT CLOB VISIBLE ,
  NODE_INFO CLOB VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76859.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.TASK_FORM.TASK_ID IS '任务id';
COMMENT ON COLUMN WORKORDER.TASK_FORM.PROCESS_INSTANCE_ID IS '流程实例id';
COMMENT ON COLUMN WORKORDER.TASK_FORM.HANDLER_ID IS '处理人id';
COMMENT ON COLUMN WORKORDER.TASK_FORM.HANDLER_NAME IS '处理人名';
COMMENT ON COLUMN WORKORDER.TASK_FORM.NODE_ID IS '节点id';
COMMENT ON COLUMN WORKORDER.TASK_FORM.NODE_NAME IS '节点名称';
COMMENT ON COLUMN WORKORDER.TASK_FORM.SUBMIT_TIME IS '提交时间';
COMMENT ON COLUMN WORKORDER.TASK_FORM.CONTENT IS '任务内容';
COMMENT ON COLUMN WORKORDER.TASK_FORM.NODE_INFO IS '此任务的节点信息';
COMMENT ON COLUMN WORKORDER.TASK_FORM.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.TASK_FORM.ID IS '主键id';

-- ----------------------------
-- Table structure for TASK_SIGN_IN
-- ----------------------------
DROP TABLE WORKORDER.TASK_SIGN_IN;
CREATE TABLE WORKORDER.TASK_SIGN_IN (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  TASK_ID VARCHAR2(64 BYTE) VISIBLE ,
  SIGN_IN_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  SIGN_IN_TIME DATE VISIBLE ,
  LONGITUDE_LATITUDE VARCHAR2(128 BYTE) VISIBLE ,
  SIGN_IN_ADDRESS VARCHAR2(128 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  SIGN_IN_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76866.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.ID IS '签到id';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.WORK_ORDER_ID IS '工单id';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.TASK_ID IS '任务id';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.SIGN_IN_USER_ID IS '签到人id';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.SIGN_IN_TIME IS '签到时间';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.LONGITUDE_LATITUDE IS '签到地址经纬度';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.SIGN_IN_ADDRESS IS '签到地址详情记录';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.TASK_SIGN_IN.SIGN_IN_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for TASK_TIME_OUT_RECORD
-- ----------------------------
DROP TABLE WORKORDER.TASK_TIME_OUT_RECORD;
CREATE TABLE WORKORDER.TASK_TIME_OUT_RECORD (
  TASK_ID VARCHAR2(64 BYTE) VISIBLE ,
  PROCESS_INSTANCE_ID VARCHAR2(64 BYTE) VISIBLE ,
  NODE_ID VARCHAR2(64 BYTE) VISIBLE ,
  START_TIME TIMESTAMP(6) VISIBLE ,
  IS_TIME_OUT VARCHAR2(8 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  IS_SEND_MSG VARCHAR2(8 BYTE) VISIBLE ,
  ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76869.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.TASK_ID IS '任务id';
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.PROCESS_INSTANCE_ID IS '流程实例id';
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.NODE_ID IS '节点id';
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.START_TIME IS '开始时间';
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.IS_TIME_OUT IS '是否超时';
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.IS_SEND_MSG IS '是否发送超时短信Y是N或空为否';
COMMENT ON COLUMN WORKORDER.TASK_TIME_OUT_RECORD.ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER;
CREATE TABLE WORKORDER.WORK_ORDER (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  STATUS_ID NUMBER(11) VISIBLE ,
  WORK_ORDER_TYPE_ID NUMBER(20) VISIBLE ,
  WORK_ORDER_TYPE_NAME VARCHAR2(255 BYTE) VISIBLE ,
  CURRENT_WORK_ORDER_NODE_ID NUMBER(20) VISIBLE ,
  CURRENT_WORK_ORDER_NODE_NAME VARCHAR2(255 BYTE) VISIBLE ,
  CURRENT_HANDLER_ID VARCHAR2(1024 BYTE) VISIBLE ,
  CURRENT_HANDLER_NAME VARCHAR2(255 BYTE) VISIBLE ,
  HISTORY_HANDLER_ID VARCHAR2(255 BYTE) VISIBLE ,
  HISTORY_HANDLER_NAME VARCHAR2(255 BYTE) VISIBLE ,
  SAVE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  SAVE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  SAVE_TIME TIMESTAMP(6) VISIBLE ,
  CREATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_TIME TIMESTAMP(6) VISIBLE ,
  LAST_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_UPDATE_TIME TIMESTAMP(6) VISIBLE ,
  CLOSE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CLOSE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  CLOSE_TIME TIMESTAMP(6) VISIBLE ,
  DELETE_STATUS NUMBER(11) VISIBLE ,
  PROCESS_INSTANCE_ID VARCHAR2(64 BYTE) VISIBLE ,
  CUSTOM_FIELD CLOB VISIBLE ,
  CUSTOM_IDENTIFY VARCHAR2(64 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  ORDER_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76872.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER.ID IS '工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.STATUS_ID IS '工单状态编号';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.WORK_ORDER_TYPE_ID IS '工单类型id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.WORK_ORDER_TYPE_NAME IS '工单类型名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CURRENT_WORK_ORDER_NODE_ID IS '当前节点id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CURRENT_WORK_ORDER_NODE_NAME IS '当前节点名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CURRENT_HANDLER_ID IS '当前处理人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CURRENT_HANDLER_NAME IS '当前处理人名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.HISTORY_HANDLER_ID IS '历史处理人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.HISTORY_HANDLER_NAME IS '历史处理人名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.SAVE_USER_ID IS '工单保存人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.SAVE_USER_NAME IS '工单保存人名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.SAVE_TIME IS '工单保存时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CREATE_USER_ID IS '工单创建人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CREATE_USER_NAME IS '工单创建人名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.LAST_USER_ID IS '工单更新人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.LAST_USER_NAME IS '工单更新人名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.LAST_UPDATE_TIME IS '更新时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CLOSE_USER_ID IS '工单关闭人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CLOSE_USER_NAME IS '工单关闭人名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CLOSE_TIME IS '关闭时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.DELETE_STATUS IS '删除状态编号';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.PROCESS_INSTANCE_ID IS '流程实例id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CUSTOM_FIELD IS '自定义字段';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.CUSTOM_IDENTIFY IS '客户唯一识别标识';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER.ORDER_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER_FIELD_REFLECT
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_FIELD_REFLECT;
CREATE TABLE WORKORDER.WORK_ORDER_FIELD_REFLECT (
  ID NUMBER(20) VISIBLE DEFAULT WORKORDER.ISEQ$$_76877.nextval   NOT NULL ,
  EXTERNAL_WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_TYPE_ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_TYPE_NODE_ID VARCHAR2(64 BYTE) VISIBLE ,
  FORM_TEMPLATE_ID VARCHAR2(64 BYTE) VISIBLE ,
  INNER_FIELD_NAME VARCHAR2(128 BYTE) VISIBLE ,
  INNER_FIELD_MEANING VARCHAR2(128 BYTE) VISIBLE ,
  EXTERNAL_FIELD_NAME VARCHAR2(128 BYTE) VISIBLE ,
  EXTERNAL_FIELD_VALUE VARCHAR2(128 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.EXTERNAL_WORK_ORDER_ID IS '外部工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.WORK_ORDER_TYPE_ID IS '工单类型id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.WORK_ORDER_TYPE_NODE_ID IS '工单节点id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.FORM_TEMPLATE_ID IS '模板id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.INNER_FIELD_NAME IS '内部字段名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.INNER_FIELD_MEANING IS '内部字段名翻译';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.EXTERNAL_FIELD_NAME IS '外部字段名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.EXTERNAL_FIELD_VALUE IS '外部字段值';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_FIELD_REFLECT.TENANT_ID IS '租户id';

-- ----------------------------
-- Table structure for WORK_ORDER_FILTER_MENU
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_FILTER_MENU;
CREATE TABLE WORKORDER.WORK_ORDER_FILTER_MENU (
  ID NUMBER(20) VISIBLE NOT NULL ,
  NAME VARCHAR2(255 BYTE) VISIBLE ,
  MENU_DESC VARCHAR2(255 BYTE) VISIBLE ,
  WORK_ORDER_TYPE_ID NUMBER(20) VISIBLE ,
  WORK_ORDER_TYPE_NAME VARCHAR2(64 BYTE) VISIBLE ,
  STATUS NUMBER(11) VISIBLE ,
  TAG_ID NUMBER(11) VISIBLE ,
  TAG_NAME VARCHAR2(64 BYTE) VISIBLE ,
  ORDERING NUMBER(11) VISIBLE ,
  CREATE_TIME TIMESTAMP(6) VISIBLE ,
  CREATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_UPDATE_TIME TIMESTAMP(6) VISIBLE ,
  FILTER_CONDITION CLOB VISIBLE ,
  FILTER_MENU_VISIBLE_TYPE VARCHAR2(64 BYTE) VISIBLE ,
  FILTER_MENU_VISIBLE_IDS VARCHAR2(255 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  FILTER_MENU_DATA_TYPE VARCHAR2(64 BYTE) VISIBLE ,
  FILTER_MENU_DATA_TYPE_IDS VARCHAR2(255 BYTE) VISIBLE ,
  PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_79484.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;

-- ----------------------------
-- Table structure for WORK_ORDER_HEAD_FIELD
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_HEAD_FIELD;
CREATE TABLE WORKORDER.WORK_ORDER_HEAD_FIELD (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  CODE VARCHAR2(64 BYTE) VISIBLE ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  STATUS NUMBER(11) VISIBLE ,
  WORK_ORDER_FILTER_MENU_ID NUMBER(20) VISIBLE ,
  TENANT_ID VARCHAR2(32 BYTE) VISIBLE ,
  FIELD_TYPE VARCHAR2(64 BYTE) VISIBLE ,
  SLOT VARCHAR2(32 BYTE) VISIBLE ,
  ORDERING NUMBER(11) VISIBLE ,
  BELONG_TO_TABLE VARCHAR2(64 BYTE) VISIBLE ,
  ORDER_HEAD_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76885.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.CODE IS '字段编码';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.NAME IS '字段名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.STATUS IS '启用状态，0启用，1禁用';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.WORK_ORDER_FILTER_MENU_ID IS '过滤器id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.FIELD_TYPE IS '字段类型';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.SLOT IS '字段格式显示';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.ORDERING IS '排序字段';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.BELONG_TO_TABLE IS '所属表名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_HEAD_FIELD.ORDER_HEAD_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Records of WORK_ORDER_HEAD_FIELD
-- ----------------------------
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('1', 'id', '编号', '0', '1', 'sys', 'input', '0', '1', 'work_order', '1');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('10', 'status_id', '状态', '0', '2', 'sys', 'select', '1', '2', 'work_order', '2');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('11', 'work_order_type_id', '工单类型', '0', '2', 'sys', 'select', '1', '3', 'work_order', '3');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('12', 'create_user_name', '创建人', '0', '2', 'sys', 'input', '1', '4', 'work_order', '4');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('13', 'create_time', '创建时间', '0', '2', 'sys', 'datetimerange', '1', '5', 'work_order', '5');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('14', 'close_time', '关闭时间', '1', '2', 'sys', 'datetime', '1', '6', 'work_order', '6');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('15', 'urge_count', '催单次数', '1', '2', 'sys', 'input', '1', '7', 'work_order_relation', '7');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('16', 'is_time_out', '超时', '1', '2', 'sys', 'input', '1', '8', 'work_order_relation', '8');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('17', 'id', '编号', '0', '3', 'sys', 'input', '0', '1', 'work_order', '9');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('18', 'status_id', '状态', '0', '3', 'sys', 'select', '1', '2', 'work_order', '10');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('19', 'work_order_type_id', '工单类型', '0', '3', 'sys', 'select', '1', '3', 'work_order', '11');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('2', 'status_id', '状态', '0', '1', 'sys', 'select', '1', '2', 'work_order', '12');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('20', 'create_user_name', '创建人', '0', '3', 'sys', 'input', '1', '4', 'work_order', '13');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('21', 'create_time', '创建时间', '0', '3', 'sys', 'datetimerange', '1', '5', 'work_order', '14');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('22', 'close_time', '关闭时间', '1', '3', 'sys', 'datetime', '1', '6', 'work_order', '15');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('23', 'urge_count', '催单次数', '1', '3', 'sys', 'input', '1', '7', 'work_order_relation', '16');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('24', 'is_time_out', '超时', '1', '3', 'sys', 'input', '1', '8', 'work_order_relation', '17');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('25', 'id', '编号', '0', '4', 'sys', 'input', '0', '1', 'work_order', '18');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('26', 'status_id', '状态', '0', '4', 'sys', 'select', '1', '2', 'work_order', '19');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('27', 'work_order_type_id', '工单类型', '0', '4', 'sys', 'select', '1', '3', 'work_order', '20');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('28', 'create_user_name', '创建人', '0', '4', 'sys', 'input', '1', '4', 'work_order', '21');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('29', 'create_time', '创建时间', '0', '4', 'sys', 'datetimerange', '1', '5', 'work_order', '22');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('3', 'work_order_type_id', '工单类型', '0', '1', 'sys', 'select', '1', '3', 'work_order', '23');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('30', 'close_time', '关闭时间', '1', '4', 'sys', 'datetime', '1', '6', 'work_order', '24');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('31', 'urge_count', '催单次数', '1', '4', 'sys', 'input', '1', '7', 'work_order_relation', '25');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('32', 'is_time_out', '超时', '1', '4', 'sys', 'input', '1', '8', 'work_order_relation', '26');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('33', 'id', '编号', '0', '5', 'sys', 'input', '0', '1', 'work_order', '27');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('34', 'status_id', '状态', '0', '5', 'sys', 'select', '1', '2', 'work_order', '28');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('35', 'work_order_type_id', '工单类型', '0', '5', 'sys', 'select', '1', '3', 'work_order', '29');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('36', 'create_user_name', '创建人', '0', '5', 'sys', 'input', '1', '4', 'work_order', '30');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('37', 'create_time', '创建时间', '0', '5', 'sys', 'datetimerange', '1', '5', 'work_order', '31');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('38', 'close_time', '关闭时间', '1', '5', 'sys', 'datetime', '1', '6', 'work_order', '32');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('39', 'urge_count', '催单次数', '1', '5', 'sys', 'input', '1', '7', 'work_order_relation', '33');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('4', 'create_user_name', '创建人', '0', '1', 'sys', 'input', '1', '4', 'work_order', '34');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('40', 'is_time_out', '超时', '1', '5', 'sys', 'input', '1', '8', 'work_order_relation', '35');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('41', 'id', '编号', '0', '6', 'sys', 'input', '0', '1', 'work_order', '36');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('42', 'status_id', '状态', '0', '6', 'sys', 'select', '1', '2', 'work_order', '37');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('43', 'work_order_type_id', '工单类型', '0', '6', 'sys', 'select', '1', '3', 'work_order', '38');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('44', 'create_user_name', '创建人', '0', '6', 'sys', 'input', '1', '4', 'work_order', '39');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('45', 'create_time', '创建时间', '0', '6', 'sys', 'datetimerange', '1', '5', 'work_order', '40');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('46', 'close_time', '关闭时间', '1', '6', 'sys', 'datetime', '1', '6', 'work_order', '41');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('47', 'urge_count', '催单次数', '1', '6', 'sys', 'input', '1', '7', 'work_order_relation', '42');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('48', 'is_time_out', '超时', '1', '6', 'sys', 'input', '1', '8', 'work_order_relation', '43');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('49', 'id', '编号', '0', '7', 'sys', 'input', '0', '1', 'work_order', '44');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('5', 'create_time', '创建时间', '0', '1', 'sys', 'datetimerange', '1', '5', 'work_order', '45');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('50', 'status_id', '状态', '0', '7', 'sys', 'select', '1', '2', 'work_order', '46');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('51', 'work_order_type_id', '工单类型', '0', '7', 'sys', 'select', '1', '3', 'work_order', '47');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('52', 'create_user_name', '创建人', '0', '7', 'sys', 'input', '1', '4', 'work_order', '48');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('53', 'create_time', '创建时间', '0', '7', 'sys', 'datetimerange', '1', '5', 'work_order', '49');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('54', 'close_time', '关闭时间', '1', '7', 'sys', 'datetime', '1', '6', 'work_order', '50');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('55', 'urge_count', '催单次数', '1', '7', 'sys', 'input', '1', '7', 'work_order_relation', '51');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('56', 'is_time_out', '超时', '1', '7', 'sys', 'input', '1', '8', 'work_order_relation', '52');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('6', 'close_time', '关闭时间', '1', '1', 'sys', 'datetime', '1', '6', 'work_order', '53');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('7', 'urge_count', '催单次数', '1', '1', 'sys', 'input', '1', '7', 'work_order_relation', '54');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('8', 'is_time_out', '超时', '1', '1', 'sys', 'input', '1', '8', 'work_order_relation', '55');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('9', 'id', '编号', '0', '2', 'sys', 'input', '0', '1', 'work_order', '56');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('57', 'create_user_id', '创建人工号', '0', '1', 'sys', 'input', '1', '9', 'work_order', '57');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('58', 'create_user_id', '创建人工号', '0', '2', 'sys', 'input', '1', '9', 'work_order', '58');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('59', 'create_user_id', '创建人工号', '0', '3', 'sys', 'input', '1', '9', 'work_order', '59');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('60', 'create_user_id', '创建人工号', '0', '4', 'sys', 'input', '1', '9', 'work_order', '60');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('61', 'create_user_id', '创建人工号', '0', '5', 'sys', 'input', '1', '9', 'work_order', '61');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('62', 'create_user_id', '创建人工号', '0', '6', 'sys', 'input', '1', '9', 'work_order', '62');
INSERT INTO WORKORDER.WORK_ORDER_HEAD_FIELD VALUES ('63', 'create_user_id', '创建人工号', '0', '7', 'sys', 'input', '1', '9', 'work_order', '63');

-- ----------------------------
-- Table structure for WORK_ORDER_LOG
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_LOG;
CREATE TABLE WORKORDER.WORK_ORDER_LOG (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_NODE_ID NUMBER(20) VISIBLE ,
  WORK_ORDER_NODE_NAME VARCHAR2(64 BYTE) VISIBLE ,
  BEFORE_TYPE_NODE_ID NUMBER(20) VISIBLE ,
  BEFORE_TYPE_NODE_NAME VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_STATUS_ID NUMBER(20) VISIBLE ,
  LOG_CREATE_TIME TIMESTAMP(6) VISIBLE ,
  LOG_CREATER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LOG_TYPE VARCHAR2(32 BYTE) VISIBLE ,
  CONTENT VARCHAR2(255 BYTE) VISIBLE ,
  LOG_CREATER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LOG_CREATER_DEPT VARCHAR2(64 BYTE) VISIBLE ,
  IS_TIME_OUT_HANDLE VARCHAR2(64 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(16 BYTE) VISIBLE ,
  SEND_ACCOUNT VARCHAR2(64 BYTE) VISIBLE ,
  NODE_MODEL_VALUE CLOB VISIBLE ,
  LOG_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76888.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.ID IS '日志id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.WORK_ORDER_ID IS '工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.WORK_ORDER_NODE_ID IS '工单类型节点id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.WORK_ORDER_NODE_NAME IS '工单类型节点名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.BEFORE_TYPE_NODE_ID IS '处理前工单类型节点id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.BEFORE_TYPE_NODE_NAME IS '处理前工单类型节点名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.WORK_ORDER_STATUS_ID IS '工单状态id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.LOG_CREATE_TIME IS '日志创建时间(产生短信时间)';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.LOG_CREATER_ID IS '日志创建人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.LOG_TYPE IS '1追加日志2催单3超时4回访5差错标记6是否有责7关注工单8取消关注9驳回10短信发送11改派12撤回13关闭14删除';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.CONTENT IS '日志内容';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.LOG_CREATER_NAME IS '日志创建人名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.LOG_CREATER_DEPT IS '日志创建人部门';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.IS_TIME_OUT_HANDLE IS '是否超时处理（Y是N和空为否）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.SEND_ACCOUNT IS '发送账号（短信，邮箱等）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.NODE_MODEL_VALUE IS '节点表单信息';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_LOG.LOG_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER_RELATION
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_RELATION;
CREATE TABLE WORKORDER.WORK_ORDER_RELATION (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  URGE_COUNT NUMBER(11) VISIBLE ,
  REDEPLOY_COUNT NUMBER(11) VISIBLE ,
  CONTACT_WORK_ORDER_ID_STR VARCHAR2(255 BYTE) VISIBLE ,
  IS_TIME_OUT VARCHAR2(32 BYTE) VISIBLE ,
  SESSION_ID VARCHAR2(64 BYTE) VISIBLE ,
  EXTERNAL_WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_MONITOR_ID VARCHAR2(255 BYTE) VISIBLE ,
  MERGE_BASE_WORK_ORDER_IDS VARCHAR2(1024 BYTE) VISIBLE ,
  IS_RECIEVE VARCHAR2(32 BYTE) VISIBLE ,
  SENDER VARCHAR2(255 BYTE) VISIBLE ,
  IS_CHILDREN NUMBER(11) VISIBLE ,
  ORDER_RELATION_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76893.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.WORK_ORDER_ID IS '工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.URGE_COUNT IS '催单次数';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.REDEPLOY_COUNT IS '转派次数';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.CONTACT_WORK_ORDER_ID_STR IS '关联工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.IS_TIME_OUT IS '是否超时';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.SESSION_ID IS '会话id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.EXTERNAL_WORK_ORDER_ID IS '外部工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.WORK_ORDER_MONITOR_ID IS '工单关注人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.MERGE_BASE_WORK_ORDER_IDS IS '合并基础工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.IS_RECIEVE IS '是否领取 Y为已领取';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.SENDER IS '抄送人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.IS_CHILDREN IS '是否子工单标识，0是父工单，1是子工单';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_RELATION.ORDER_RELATION_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER_STATUS
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_STATUS;
CREATE TABLE WORKORDER.WORK_ORDER_STATUS (
  ID NUMBER(20) VISIBLE NOT NULL ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  TAG NUMBER(11) VISIBLE ,
  ORDERING NUMBER(11) VISIBLE ,
  CREATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_TIME TIMESTAMP(6) VISIBLE ,
  LAST_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_UPDATE_TIME TIMESTAMP(6) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76896.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.NAME IS '状态名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.TAG IS '创建标识1系统创建0自定义创建';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.ORDERING IS '排序';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.CREATE_USER_ID IS '创建人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.CREATE_USER_NAME IS '创建人名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.LAST_USER_ID IS '最后修改人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.LAST_USER_NAME IS '最后修改名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.LAST_UPDATE_TIME IS '最后修改时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_STATUS.PRIMARY_ID IS '主键';

-- ----------------------------
-- Records of WORK_ORDER_STATUS
-- ----------------------------
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('1', '编辑中', '1', '1', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '2');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('2', '处理中', '1', '2', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '3');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('3', '已完成', '1', '3', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '4');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('4', '已关闭', '1', '4', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '5');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('5', '预留状态1', '1', '5', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '6');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('6', '预留状态2', '1', '6', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '7');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('7', '预留状态3', '1', '7', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '8');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('8', '预留状态4', '1', '8', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '9');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('9', '预留状态5', '1', '9', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '10');
INSERT INTO WORKORDER.WORK_ORDER_STATUS VALUES ('10', '预留状态6', '1', '10', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'default', '11');

-- ----------------------------
-- Table structure for WORK_ORDER_TRIGGER_INFO
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_TRIGGER_INFO;
CREATE TABLE WORKORDER.WORK_ORDER_TRIGGER_INFO (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_TIME DATE VISIBLE ,
  CREATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  UPDATE_TIME DATE VISIBLE ,
  UPDATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  STATUS VARCHAR2(8 BYTE) VISIBLE ,
  DELETED VARCHAR2(8 BYTE) VISIBLE ,
  TRIGGER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  TRIGGER_DESCRIBE VARCHAR2(255 BYTE) VISIBLE ,
  WORK_ORDER_TYPE_ID VARCHAR2(64 BYTE) VISIBLE ,
  TRIGGER_CONDITION CLOB VISIBLE ,
  TRIGGER_ACTION CLOB VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  TRIGGER_TYPE VARCHAR2(8 BYTE) VISIBLE ,
  TRIGGER_INFO_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76899.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.CREATE_USER_ID IS '创建人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.CREATE_USER_NAME IS '创建人名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.UPDATE_TIME IS '修改时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.UPDATE_USER_ID IS '修改人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.STATUS IS '触发器状态';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.DELETED IS '删除状态（0正常1删除）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.TRIGGER_NAME IS '触发器名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.TRIGGER_DESCRIBE IS '触发器描述';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.WORK_ORDER_TYPE_ID IS '工单类型id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.TRIGGER_CONDITION IS '触发器条件';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.TRIGGER_ACTION IS '触发器执行动作';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.TRIGGER_TYPE IS '触发器类型（0多次1单次）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_INFO.TRIGGER_INFO_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER_TRIGGER_RELATION
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_TRIGGER_RELATION;
CREATE TABLE WORKORDER.WORK_ORDER_TRIGGER_RELATION (
  ID VARCHAR2(64 BYTE) VISIBLE ,
  TRIGGER_ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_TIME DATE VISIBLE ,
  TRIGGER_RELATION_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76906.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_RELATION.TRIGGER_ID IS '触发器id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_RELATION.WORK_ORDER_ID IS '执行工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_RELATION.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TRIGGER_RELATION.TRIGGER_RELATION_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER_TYPE
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_TYPE;
CREATE TABLE WORKORDER.WORK_ORDER_TYPE (
  ID NUMBER(20) VISIBLE ,
  NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_UPDATE_TIME TIMESTAMP(6) VISIBLE ,
  USE_STATUS NUMBER(11) VISIBLE ,
  DELETE_STATUS NUMBER(11) VISIBLE ,
  EDIT_STATUS NUMBER(11) VISIBLE ,
  CONTENT CLOB VISIBLE ,
  TYPE_VISIABLE_IDS VARCHAR2(255 BYTE) VISIBLE ,
  VISIABLE_TYPE VARCHAR2(64 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  MAX_VERSION NUMBER(11) VISIBLE ,
  TYPE_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76909.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.ID IS '工单类型id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.NAME IS '工单类型名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.LAST_USER_ID IS '最后修改人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.LAST_USER_NAME IS '最后修改人名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.LAST_UPDATE_TIME IS '最后修改时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.USE_STATUS IS '使用状态1启用0停用';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.DELETE_STATUS IS '删除状态0正常1删除';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.EDIT_STATUS IS '是否可以编辑1是0否';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.CONTENT IS '工单类型内容';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.TYPE_VISIABLE_IDS IS '工单类型可见人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.VISIABLE_TYPE IS '可见范围类型';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.MAX_VERSION IS '工单类型最大版本号';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE.TYPE_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER_TYPE_MENU
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_TYPE_MENU;
CREATE TABLE WORKORDER.WORK_ORDER_TYPE_MENU (
  ID NUMBER(20) VISIBLE ,
  MENU_NAME VARCHAR2(255 BYTE) VISIBLE ,
  WORK_ORDER_TYPE_ID NUMBER(20) VISIBLE ,
  WORK_ORDER_TYPE_NAME VARCHAR2(64 BYTE) VISIBLE ,
  STATUS NUMBER(11) VISIBLE ,
  TAG_ID NUMBER(11) VISIBLE ,
  TAG_NAME VARCHAR2(64 BYTE) VISIBLE ,
  MENU_DESC VARCHAR2(255 BYTE) VISIBLE ,
  ORDERING NUMBER(11) VISIBLE ,
  CREATE_TIME TIMESTAMP(6) VISIBLE ,
  CREATE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  CREATE_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  LAST_USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  LAST_UPDATE_TIME TIMESTAMP(6) VISIBLE ,
  MENU_VISIBLE_TYPE VARCHAR2(64 BYTE) VISIBLE ,
  MENU_VISIBLE_IDS VARCHAR2(255 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76914.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.MENU_NAME IS '菜单名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.WORK_ORDER_TYPE_ID IS '工单类型id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.WORK_ORDER_TYPE_NAME IS '工单类型名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.STATUS IS '状态id启用1通用0';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.TAG_ID IS '1系统内置0自定义';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.TAG_NAME IS '标签名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.MENU_DESC IS '菜单描述';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.ORDERING IS '排序';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.CREATE_TIME IS '创建时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.CREATE_USER_ID IS '创建人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.CREATE_USER_NAME IS '创建人名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.LAST_USER_ID IS '最后修改人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.LAST_USER_NAME IS '最后修改人名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.LAST_UPDATE_TIME IS '最后修改时间';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.MENU_VISIBLE_TYPE IS '菜单可见范围类型（all全部dept部门role角色user用户）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.MENU_VISIBLE_IDS IS '可见范围id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_MENU.TENANT_ID IS '租户id';

-- ----------------------------
-- Records of WORK_ORDER_TYPE_MENU
-- ----------------------------
INSERT INTO WORKORDER.WORK_ORDER_TYPE_MENU VALUES ('1', '我的工单', '0', '无', '1', '1', '系统内置', '我的工单', '15', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), '0', '系统', '0', '系统', TO_TIMESTAMP('2020-02-26 11:07:25.000000', 'SYYYY-MM-DD HH24:MI:SS:FF6'), 'all', NULL, 'default', '1');

-- ----------------------------
-- Table structure for WORK_ORDER_TYPE_NODE
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_TYPE_NODE;
CREATE TABLE WORKORDER.WORK_ORDER_TYPE_NODE (
  ID NUMBER(20) VISIBLE ,
  WORK_ORDER_TYPEID NUMBER(20) VISIBLE ,
  NAME VARCHAR2(255 BYTE) VISIBLE ,
  FORMTEMPLATEID NUMBER(11) VISIBLE ,
  CONTENT CLOB VISIBLE ,
  TAG NUMBER(11) VISIBLE ,
  DISTRIBUTE_WAY VARCHAR2(64 BYTE) VISIBLE ,
  LAST_DISTRIBUTE_USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE ,
  WORK_ORDER_TYPE_VERSION NUMBER(11) VISIBLE ,
  FORM_TEMPALTE_CONTENT CLOB VISIBLE ,
  FORM_KEY_SIGN VARCHAR2(16 BYTE) VISIBLE ,
  NODE_PRIMARY_ID NUMBER(11) VISIBLE DEFAULT WORKORDER.ISEQ$$_76917.nextval   NOT NULL 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  INITIAL 65536 
  NEXT 1048576 
  MINEXTENTS 1
  MAXEXTENTS 2147483645
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.ID IS '工单类型节点id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.WORK_ORDER_TYPEID IS '工单类型id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.NAME IS '工单类型节点名称';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.FORMTEMPLATEID IS '表达模板id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.CONTENT IS '节点基础模板信息集';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.TAG IS '是否为初始节点（1是，其他否）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.DISTRIBUTE_WAY IS '工单派发方式（work_order_pool工单池receive_way领取方式sequence_distribution依次自动分配）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.LAST_DISTRIBUTE_USER_ID IS '依次派发工单模式，最后派发人id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.TENANT_ID IS '租户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.WORK_ORDER_TYPE_VERSION IS '工单类型版本号';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.FORM_TEMPALTE_CONTENT IS '工单类型模板内容';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.FORM_KEY_SIGN IS '流程节点配置模板标识0单模板1问题类型多模板';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_TYPE_NODE.NODE_PRIMARY_ID IS '主键id';

-- ----------------------------
-- Table structure for WORK_ORDER_URGE
-- ----------------------------
DROP TABLE WORKORDER.WORK_ORDER_URGE;
CREATE TABLE WORKORDER.WORK_ORDER_URGE (
  ID NUMBER(20) VISIBLE DEFAULT WORKORDER.ISEQ$$_76924.nextval   NOT NULL ,
  WORK_ORDER_ID VARCHAR2(64 BYTE) VISIBLE ,
  USER_ID VARCHAR2(64 BYTE) VISIBLE ,
  USER_NAME VARCHAR2(64 BYTE) VISIBLE ,
  STATUS NUMBER(11) VISIBLE ,
  CREATE_TIME TIMESTAMP(6) VISIBLE ,
  CONTENT VARCHAR2(255 BYTE) VISIBLE ,
  TENANT_ID VARCHAR2(64 BYTE) VISIBLE 
)
TABLESPACE WORKORDER
LOGGING
NOCOMPRESS
PCTFREE 10
INITRANS 1
STORAGE (
  BUFFER_POOL DEFAULT
)
PARALLEL 1
NOCACHE
DISABLE ROW MOVEMENT
;
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.ID IS '主键id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.WORK_ORDER_ID IS '工单id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.USER_ID IS '用户id';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.USER_NAME IS '用户名';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.STATUS IS '状态id（0启用1停用）';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.CREATE_TIME IS '创建事件';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.CONTENT IS '催单信息';
COMMENT ON COLUMN WORKORDER.WORK_ORDER_URGE.TENANT_ID IS '租户id';

-- ----------------------------
-- Function structure for FIND_IN_SET
-- ----------------------------
CREATE OR REPLACE
FUNCTION WORKORDER.FIND_IN_SET AS
BEGIN  
 
-- 如果piv_str中没有分割符，直接判断piv_str1和piv_str是否相等，相等 res=1  
 
IF instr(piv_str, p_sep, 1) = 0 THEN  
 
   IF piv_str = piv_str1 THEN   
 
      res:= 1;  
 
   END IF;  
 
ELSE  
 
-- 循环按分隔符截取piv_str  
 
LOOP  
 
    l_idx := instr(piv_str,p_sep);  
 
     loopIndex:=loopIndex+1;
 
-- 当piv_str中还有分隔符时  
 
      IF l_idx > 0 THEN  
 
 
   -- 截取第一个分隔符前的字段str  
 
         str:= substr(piv_str,1,l_idx-1);  
 
   -- 判断 str 和piv_str1 是否相等，相等 res=1 并结束循环判断  
 
         IF str = piv_str1 THEN   
 
           res:= loopIndex;  
 
           EXIT;  
 
         END IF;  
 
        piv_str := substr(piv_str,l_idx+length(p_sep));  
 
      ELSE  
 
   -- 当截取后的piv_str 中不存在分割符时，判断piv_str和piv_str1是否相等，相等 res=1  
 
        IF piv_str = piv_str1 THEN   
 
           res:= loopIndex;  
 
        END IF;  
 
        -- 无论最后是否相等，都跳出循环  
 
        EXIT;  
 
      END IF;  
 
END LOOP;  
 
-- 结束循环  
 
END IF;  
 
-- 返回res  
 
RETURN res;  
 
END FIND_IN_SET;
/

-- ----------------------------
-- Function structure for ISIN
-- ----------------------------
CREATE OR REPLACE
FUNCTION WORKORDER.ISIN AS
begin
  if (a is null or b is null) then
    return v_res;
  end if;
  if (a is not null and b is not null) then
    V_LENGTH  := LENGTH(a) - LENGTH(REPLACE(a, ',', '')) + 1;
    V_LENGTH1 := LENGTH(b) - LENGTH(REPLACE(b, ',', '')) + 1;
    FOR i IN 1 .. V_LENGTH LOOP
      SELECT REGEXP_SUBSTR(a, '[^,]+', 1, i) INTO V_TMP FROM DUAL;
      FOR j IN 1 .. V_LENGTH1 LOOP
        SELECT REGEXP_SUBSTR(b, '[^,]+', 1, j) INTO V_TMP1 FROM DUAL;
        DBMS_OUTPUT.put_line(V_TMP);
        if (V_TMP = V_TMP1) then
          v_res := '1';
          return v_res;
          exit;
        end if;
      END LOOP; 
    END LOOP;
    return v_res;
  end if;
end isin;
/

-- ----------------------------
-- Sequence structure for ACT_EVT_LOG_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.ACT_EVT_LOG_SEQ;
CREATE SEQUENCE WORKORDER.ACT_EVT_LOG_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for AGENT_SESSION_INFO_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.AGENT_SESSION_INFO_SEQ;
CREATE SEQUENCE WORKORDER.AGENT_SESSION_INFO_SEQ MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for DATA_DICTIONARY_INFO_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.DATA_DICTIONARY_INFO_SEQ;
CREATE SEQUENCE WORKORDER.DATA_DICTIONARY_INFO_SEQ MINVALUE 30 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CYCLE NOCACHE;

-- ----------------------------
-- Sequence structure for DATA_DICTIONARY_ORDER_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.DATA_DICTIONARY_ORDER_SEQ;
CREATE SEQUENCE WORKORDER.DATA_DICTIONARY_ORDER_SEQ MINVALUE 40 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CYCLE NOCACHE;

-- ----------------------------
-- Sequence structure for DIALOGUE_INFO_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.DIALOGUE_INFO_SEQ;
CREATE SEQUENCE WORKORDER.DIALOGUE_INFO_SEQ MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for ISEQ$$_74851
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_74851;
CREATE SEQUENCE WORKORDER.ISEQ$$_74851 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_74855
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_74855;
CREATE SEQUENCE WORKORDER.ISEQ$$_74855 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_74876
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_74876;
CREATE SEQUENCE WORKORDER.ISEQ$$_74876 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_75258
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_75258;
CREATE SEQUENCE WORKORDER.ISEQ$$_75258 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_75901
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_75901;
CREATE SEQUENCE WORKORDER.ISEQ$$_75901 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76351
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76351;
CREATE SEQUENCE WORKORDER.ISEQ$$_76351 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76802
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76802;
CREATE SEQUENCE WORKORDER.ISEQ$$_76802 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76810
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76810;
CREATE SEQUENCE WORKORDER.ISEQ$$_76810 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76813
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76813;
CREATE SEQUENCE WORKORDER.ISEQ$$_76813 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76816
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76816;
CREATE SEQUENCE WORKORDER.ISEQ$$_76816 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76823
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76823;
CREATE SEQUENCE WORKORDER.ISEQ$$_76823 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76826
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76826;
CREATE SEQUENCE WORKORDER.ISEQ$$_76826 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76831
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76831;
CREATE SEQUENCE WORKORDER.ISEQ$$_76831 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76834
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76834;
CREATE SEQUENCE WORKORDER.ISEQ$$_76834 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76840
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76840;
CREATE SEQUENCE WORKORDER.ISEQ$$_76840 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76845
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76845;
CREATE SEQUENCE WORKORDER.ISEQ$$_76845 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76848
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76848;
CREATE SEQUENCE WORKORDER.ISEQ$$_76848 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76851
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76851;
CREATE SEQUENCE WORKORDER.ISEQ$$_76851 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76856
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76856;
CREATE SEQUENCE WORKORDER.ISEQ$$_76856 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76859
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76859;
CREATE SEQUENCE WORKORDER.ISEQ$$_76859 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76866
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76866;
CREATE SEQUENCE WORKORDER.ISEQ$$_76866 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76869
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76869;
CREATE SEQUENCE WORKORDER.ISEQ$$_76869 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76872
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76872;
CREATE SEQUENCE WORKORDER.ISEQ$$_76872 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76877
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76877;
CREATE SEQUENCE WORKORDER.ISEQ$$_76877 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76880
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76880;
CREATE SEQUENCE WORKORDER.ISEQ$$_76880 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76885
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76885;
CREATE SEQUENCE WORKORDER.ISEQ$$_76885 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76888
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76888;
CREATE SEQUENCE WORKORDER.ISEQ$$_76888 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76893
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76893;
CREATE SEQUENCE WORKORDER.ISEQ$$_76893 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76896
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76896;
CREATE SEQUENCE WORKORDER.ISEQ$$_76896 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76899
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76899;
CREATE SEQUENCE WORKORDER.ISEQ$$_76899 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76906
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76906;
CREATE SEQUENCE WORKORDER.ISEQ$$_76906 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76909
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76909;
CREATE SEQUENCE WORKORDER.ISEQ$$_76909 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76914
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76914;
CREATE SEQUENCE WORKORDER.ISEQ$$_76914 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76917
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76917;
CREATE SEQUENCE WORKORDER.ISEQ$$_76917 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76924
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76924;
CREATE SEQUENCE WORKORDER.ISEQ$$_76924 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_76927
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_76927;
CREATE SEQUENCE WORKORDER.ISEQ$$_76927 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_77148
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_77148;
CREATE SEQUENCE WORKORDER.ISEQ$$_77148 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_77166
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_77166;
CREATE SEQUENCE WORKORDER.ISEQ$$_77166 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_79484
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_79484;
CREATE SEQUENCE WORKORDER.ISEQ$$_79484 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for ISEQ$$_84884
-- ----------------------------
DROP SEQUENCE WORKORDER.ISEQ$$_84884;
CREATE SEQUENCE WORKORDER.ISEQ$$_84884 MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_ACCESS_CONFIG_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_ACCESS_CONFIG_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_ACCESS_CONFIG_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGENT_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_AGENT_OPERATE_RECORD_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_OPERATE_RECORD_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_OPERATE_RECORD_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGENT_PERSONALIZE_CONFIG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_PERSONALIZE_CONFIG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_PERSONALIZE_CONFIG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGENT_PROCESS_INLINE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_PROCESS_INLINE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_PROCESS_INLINE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGENT_PROCESS_SYS_MSG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_PROCESS_SYS_MSG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_PROCESS_SYS_MSG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGENT_SESSION_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_SESSION_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_SESSION_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGENT_SYSTEM_MESSAGE_PERSON_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_SYSTEM_MESSAGE_PERSON_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_SYSTEM_MESSAGE_PERSON_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGENT_SYSTEM_MESSAGE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGENT_SYSTEM_MESSAGE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGENT_SYSTEM_MESSAGE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGREEMENT_USAGE_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGREEMENT_USAGE_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGREEMENT_USAGE_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_AGREEMENT_VERSION_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_AGREEMENT_VERSION_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_AGREEMENT_VERSION_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_APP_CUSTOMER_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_APP_CUSTOMER_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_APP_CUSTOMER_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_BRIEFBUSISORT_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_BRIEFBUSISORT_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_BRIEFBUSISORT_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_BUSINESS_GROUP_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_BUSINESS_GROUP_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_BUSINESS_GROUP_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CHANNEL_PARAMETER_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CHANNEL_PARAMETER_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CHANNEL_PARAMETER_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CLIENT_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CLIENT_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CLIENT_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_CLIENT_LABEL_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CLIENT_LABEL_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CLIENT_LABEL_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CONFERENCE_FILE_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CONFERENCE_FILE_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CONFERENCE_FILE_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CONFERENCE_FILE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CONFERENCE_FILE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CONFERENCE_FILE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 200;

-- ----------------------------
-- Sequence structure for MCC_CONF_VIDEO_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CONF_VIDEO_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CONF_VIDEO_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CUSTOMER_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CUSTOMER_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CUSTOMER_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_CUSTOMER_TRACE_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CUSTOMER_TRACE_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CUSTOMER_TRACE_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CUSTOMER_WEBPAGE_MAPPING_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CUSTOMER_WEBPAGE_MAPPING_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CUSTOMER_WEBPAGE_MAPPING_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CUS_INTERACT_T_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CUS_INTERACT_T_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CUS_INTERACT_T_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CUS_MESSAGE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CUS_MESSAGE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CUS_MESSAGE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CUS_PARAM_CONFIG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CUS_PARAM_CONFIG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CUS_PARAM_CONFIG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_CUS_SATISFACTION_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_CUS_SATISFACTION_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_CUS_SATISFACTION_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_EMPLOYEE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_EMPLOYEE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_EMPLOYEE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_EVALUATION_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_EVALUATION_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_EVALUATION_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 50;

-- ----------------------------
-- Sequence structure for MCC_FAX_MOULD_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_FAX_MOULD_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_FAX_MOULD_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 100;

-- ----------------------------
-- Sequence structure for MCC_FIXED_QUESTION_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_FIXED_QUESTION_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_FIXED_QUESTION_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_GROUP_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_GROUP_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_GROUP_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_HISTORY_SUMMARY_CONFG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_HISTORY_SUMMARY_CONFG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_HISTORY_SUMMARY_CONFG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_HISTORY_SUMMARY_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_HISTORY_SUMMARY_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_HISTORY_SUMMARY_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_HISTORY_SUMMARY_TEMP_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_HISTORY_SUMMARY_TEMP_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_HISTORY_SUMMARY_TEMP_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_IVRACTION_NAME_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_IVRACTION_NAME_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_IVRACTION_NAME_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_IVRCONFIG_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_IVRCONFIG_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_IVRCONFIG_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_IVR_CALLLOG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_IVR_CALLLOG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_IVR_CALLLOG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_IVR_SURVEY_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_IVR_SURVEY_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_IVR_SURVEY_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_KNOWLEDGE_REPLY_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_KNOWLEDGE_REPLY_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_KNOWLEDGE_REPLY_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_LABEL_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_LABEL_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_LABEL_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_LEAVE_MESSAGE_CONF_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_CONF_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_CONF_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_LEAVE_MESSAGE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 100;

-- ----------------------------
-- Sequence structure for MCC_LEAVE_MESSAGE_TRANSFER_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_TRANSFER_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_TRANSFER_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 100;

-- ----------------------------
-- Sequence structure for MCC_LEAVE_MESSAGE_WORKLOAD_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_WORKLOAD_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_LEAVE_MESSAGE_WORKLOAD_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_MECHANISM_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_MECHANISM_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_MECHANISM_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_MID_CHATRECORDS_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_MID_CHATRECORDS_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_MID_CHATRECORDS_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_MID_LEAVE_MESSAGE_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_MID_LEAVE_MESSAGE_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_MID_LEAVE_MESSAGE_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_MID_LEAVE_MESSAGE_NOAGG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_MID_LEAVE_MESSAGE_NOAGG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_MID_LEAVE_MESSAGE_NOAGG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_MISSED_CALL_INFOS_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_MISSED_CALL_INFOS_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_MISSED_CALL_INFOS_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_MSG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_MSG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_MSG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_PAGE_VISIT_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_PAGE_VISIT_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_PAGE_VISIT_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_PARAM_CONFIG_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_PARAM_CONFIG_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_PARAM_CONFIG_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_PHONE_ATTR_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_PHONE_ATTR_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_PHONE_ATTR_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_PROMOTE_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_PROMOTE_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_PROMOTE_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RANDOM_QUESTION_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RANDOM_QUESTION_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RANDOM_QUESTION_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RECOMMENDED_LIST_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RECOMMENDED_LIST_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RECOMMENDED_LIST_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RECOMMEND_DIRECTORY_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RECOMMEND_DIRECTORY_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RECOMMEND_DIRECTORY_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RECOMMEND_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RECOMMEND_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RECOMMEND_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RED_BLACK_LIST_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RED_BLACK_LIST_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RED_BLACK_LIST_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_REPLYMENT_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_REPLYMENT_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_REPLYMENT_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RETURN_VISIT_DETAIL_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RETURN_VISIT_DETAIL_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RETURN_VISIT_DETAIL_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RETURN_VISIT_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RETURN_VISIT_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RETURN_VISIT_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RISK_KNOWLEDGE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RISK_KNOWLEDGE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RISK_KNOWLEDGE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_RISK_KNOWLEDGE_TABLE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_RISK_KNOWLEDGE_TABLE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_RISK_KNOWLEDGE_TABLE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_ROBOT_EVALUATE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_ROBOT_EVALUATE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_ROBOT_EVALUATE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_ROBOT_FUNCTIONID_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_ROBOT_FUNCTIONID_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_ROBOT_FUNCTIONID_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_ROBOT_USAGE_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_ROBOT_USAGE_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_ROBOT_USAGE_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_ROLE_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_ROLE_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_ROLE_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 50;

-- ----------------------------
-- Sequence structure for MCC_SENSITIVE_MESSAGE_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_SENSITIVE_MESSAGE_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_SENSITIVE_MESSAGE_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_SIGNALS_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_SIGNALS_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_SIGNALS_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_TBL_BASE_AGENT_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_TBL_BASE_AGENT_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_TBL_BASE_AGENT_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_TENANT_AGENT_BIZ_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_TENANT_AGENT_BIZ_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_TENANT_AGENT_BIZ_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_TENANT_BUSINESS_CLASS_CONFIG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_TENANT_BUSINESS_CLASS_CONFIG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_TENANT_BUSINESS_CLASS_CONFIG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 20;

-- ----------------------------
-- Sequence structure for MCC_TENANT_BUSINESS_CLASS_CONFIG_S_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_TENANT_BUSINESS_CLASS_CONFIG_S_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_TENANT_BUSINESS_CLASS_CONFIG_S_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_TENANT_CLIENT_LEVEL_CONFIG_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_TENANT_CLIENT_LEVEL_CONFIG_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_TENANT_CLIENT_LEVEL_CONFIG_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_TENANT_HINTS_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_TENANT_HINTS_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_TENANT_HINTS_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_TODO_LIST_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_TODO_LIST_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_TODO_LIST_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 1000;

-- ----------------------------
-- Sequence structure for MCC_USER_INFO_SEQUENCE
-- ----------------------------
DROP SEQUENCE WORKORDER.MCC_USER_INFO_SEQUENCE;
CREATE SEQUENCE WORKORDER.MCC_USER_INFO_SEQUENCE MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 100;

-- ----------------------------
-- Sequence structure for STATUS_INFO_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.STATUS_INFO_SEQ;
CREATE SEQUENCE WORKORDER.STATUS_INFO_SEQ MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 200;

-- ----------------------------
-- Sequence structure for USERDATA_INFO_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.USERDATA_INFO_SEQ;
CREATE SEQUENCE WORKORDER.USERDATA_INFO_SEQ MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 100;

-- ----------------------------
-- Sequence structure for VDN_SESSION_INFO_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.VDN_SESSION_INFO_SEQ;
CREATE SEQUENCE WORKORDER.VDN_SESSION_INFO_SEQ MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 CACHE 200;

-- ----------------------------
-- Sequence structure for ZT_CUSINFO_SEQ
-- ----------------------------
DROP SEQUENCE WORKORDER.ZT_CUSINFO_SEQ;
CREATE SEQUENCE WORKORDER.ZT_CUSINFO_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 CYCLE NOCACHE;

-- ----------------------------
-- Primary Key structure for table CUSTOM_FIELD
-- ----------------------------
ALTER TABLE WORKORDER.CUSTOM_FIELD ADD CONSTRAINT SYS_C0015634 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table CUSTOM_FIELD
-- ----------------------------
ALTER TABLE WORKORDER.CUSTOM_FIELD ADD CONSTRAINT CONTENT_DATA_JSON CHECK (content IS JSON) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.CUSTOM_FIELD ADD CONSTRAINT SYS_C0015632 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.CUSTOM_FIELD ADD CONSTRAINT SYS_C0028310 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.CUSTOM_FIELD ADD CONSTRAINT SYS_C0028612 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Checks structure for table CUSTOM_FIELD_DATA_SOURCE
-- ----------------------------
ALTER TABLE WORKORDER.CUSTOM_FIELD_DATA_SOURCE ADD CONSTRAINT DATA_CONTENT_JSON CHECK (data_content IS JSON) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table EWS_DEPARTMENT
-- ----------------------------
ALTER TABLE WORKORDER.EWS_DEPARTMENT ADD CONSTRAINT SYS_C0015638 PRIMARY KEY (DEPT_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table EWS_DEPARTMENT
-- ----------------------------
ALTER TABLE WORKORDER.EWS_DEPARTMENT ADD CONSTRAINT SYS_C0015636 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_DEPARTMENT ADD CONSTRAINT SYS_C0015637 CHECK (DEPT_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_DEPARTMENT ADD CONSTRAINT SYS_C0028311 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_DEPARTMENT ADD CONSTRAINT SYS_C0028312 CHECK (DEPT_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_DEPARTMENT ADD CONSTRAINT SYS_C0028613 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_DEPARTMENT ADD CONSTRAINT SYS_C0028614 CHECK (DEPT_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table EWS_ROLE
-- ----------------------------
ALTER TABLE WORKORDER.EWS_ROLE ADD CONSTRAINT SYS_C0015641 PRIMARY KEY (ROLE_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table EWS_ROLE
-- ----------------------------
ALTER TABLE WORKORDER.EWS_ROLE ADD CONSTRAINT SYS_C0015639 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_ROLE ADD CONSTRAINT SYS_C0015640 CHECK (ROLE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_ROLE ADD CONSTRAINT SYS_C0028313 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_ROLE ADD CONSTRAINT SYS_C0028314 CHECK (ROLE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_ROLE ADD CONSTRAINT SYS_C0028615 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_ROLE ADD CONSTRAINT SYS_C0028616 CHECK (ROLE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table EWS_USER
-- ----------------------------
ALTER TABLE WORKORDER.EWS_USER ADD CONSTRAINT SYS_C0015643 PRIMARY KEY (USER_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table EWS_USER
-- ----------------------------
ALTER TABLE WORKORDER.EWS_USER ADD CONSTRAINT SYS_C0015642 CHECK (USER_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_USER ADD CONSTRAINT SYS_C0028315 CHECK (USER_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_USER ADD CONSTRAINT SYS_C0028617 CHECK (USER_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table EWS_USER_ROLE
-- ----------------------------
ALTER TABLE WORKORDER.EWS_USER_ROLE ADD CONSTRAINT SYS_C0015648 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table EWS_USER_ROLE
-- ----------------------------
ALTER TABLE WORKORDER.EWS_USER_ROLE ADD CONSTRAINT SYS_C0015647 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_USER_ROLE ADD CONSTRAINT SYS_C0028316 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EWS_USER_ROLE ADD CONSTRAINT SYS_C0028618 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table EXTERNAL_FLOW_INFO
-- ----------------------------
ALTER TABLE WORKORDER.EXTERNAL_FLOW_INFO ADD CONSTRAINT SYS_C0015651 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table EXTERNAL_FLOW_INFO
-- ----------------------------
ALTER TABLE WORKORDER.EXTERNAL_FLOW_INFO ADD CONSTRAINT FLOW_INFO_JSON CHECK (external_flow_info IS JSON) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EXTERNAL_FLOW_INFO ADD CONSTRAINT SYS_C0015649 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EXTERNAL_FLOW_INFO ADD CONSTRAINT SYS_C0028317 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.EXTERNAL_FLOW_INFO ADD CONSTRAINT SYS_C0028619 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table FILTER_FIRST
-- ----------------------------
ALTER TABLE WORKORDER.FILTER_FIRST ADD CONSTRAINT SYS_C0015653 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table FILTER_FIRST
-- ----------------------------
ALTER TABLE WORKORDER.FILTER_FIRST ADD CONSTRAINT SYS_C0015652 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.FILTER_FIRST ADD CONSTRAINT SYS_C0028318 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.FILTER_FIRST ADD CONSTRAINT SYS_C0028620 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table FILTER_SECOND
-- ----------------------------
ALTER TABLE WORKORDER.FILTER_SECOND ADD CONSTRAINT SYS_C0027588 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table FILTER_SECOND
-- ----------------------------
ALTER TABLE WORKORDER.FILTER_SECOND ADD CONSTRAINT SYS_C0027587 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.FILTER_SECOND ADD CONSTRAINT SYS_C0028319 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.FILTER_SECOND ADD CONSTRAINT SYS_C0028621 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table FORM_TEMPLATE
-- ----------------------------
ALTER TABLE WORKORDER.FORM_TEMPLATE ADD CONSTRAINT SYS_C0015659 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table FORM_TEMPLATE
-- ----------------------------
ALTER TABLE WORKORDER.FORM_TEMPLATE ADD CONSTRAINT SYS_C0015657 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.FORM_TEMPLATE ADD CONSTRAINT SYS_C0028320 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.FORM_TEMPLATE ADD CONSTRAINT SYS_C0028622 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table MSG_NOTIFY_SETTING
-- ----------------------------
ALTER TABLE WORKORDER.MSG_NOTIFY_SETTING ADD CONSTRAINT SYS_C0015661 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table MSG_NOTIFY_SETTING
-- ----------------------------
ALTER TABLE WORKORDER.MSG_NOTIFY_SETTING ADD CONSTRAINT SYS_C0015660 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.MSG_NOTIFY_SETTING ADD CONSTRAINT SYS_C0028321 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.MSG_NOTIFY_SETTING ADD CONSTRAINT SYS_C0028623 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table MSG_SETTING_RELATION
-- ----------------------------
ALTER TABLE WORKORDER.MSG_SETTING_RELATION ADD CONSTRAINT SYS_C0015663 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table MSG_SETTING_RELATION
-- ----------------------------
ALTER TABLE WORKORDER.MSG_SETTING_RELATION ADD CONSTRAINT SYS_C0015662 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.MSG_SETTING_RELATION ADD CONSTRAINT SYS_C0028322 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.MSG_SETTING_RELATION ADD CONSTRAINT SYS_C0028624 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table MSG_TEMPLATE
-- ----------------------------
ALTER TABLE WORKORDER.MSG_TEMPLATE ADD CONSTRAINT SYS_C0015666 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table MSG_TEMPLATE
-- ----------------------------
ALTER TABLE WORKORDER.MSG_TEMPLATE ADD CONSTRAINT ATTACHMENT_JSON CHECK (attachment_address is json) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.MSG_TEMPLATE ADD CONSTRAINT SYS_C0015664 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.MSG_TEMPLATE ADD CONSTRAINT SYS_C0028323 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.MSG_TEMPLATE ADD CONSTRAINT SYS_C0028625 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table SYS_DICT
-- ----------------------------
ALTER TABLE WORKORDER.SYS_DICT ADD CONSTRAINT SYS_C0015669 PRIMARY KEY (DICT_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table SYS_DICT
-- ----------------------------
ALTER TABLE WORKORDER.SYS_DICT ADD CONSTRAINT SYS_C0015667 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.SYS_DICT ADD CONSTRAINT SYS_C0015668 CHECK (DICT_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.SYS_DICT ADD CONSTRAINT SYS_C0028325 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.SYS_DICT ADD CONSTRAINT SYS_C0028326 CHECK (DICT_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.SYS_DICT ADD CONSTRAINT SYS_C0028627 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.SYS_DICT ADD CONSTRAINT SYS_C0028628 CHECK (DICT_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table TASK_FORM
-- ----------------------------
ALTER TABLE WORKORDER.TASK_FORM ADD CONSTRAINT SYS_C0015673 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table TASK_FORM
-- ----------------------------
ALTER TABLE WORKORDER.TASK_FORM ADD CONSTRAINT NODE_INFO_JSON CHECK (node_info is json) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_FORM ADD CONSTRAINT SYS_C0015670 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_FORM ADD CONSTRAINT SYS_C0028327 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_FORM ADD CONSTRAINT SYS_C0028629 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_FORM ADD CONSTRAINT TASK_FORM_CONTENT_JSON CHECK (content is json) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table TASK_SIGN_IN
-- ----------------------------
ALTER TABLE WORKORDER.TASK_SIGN_IN ADD CONSTRAINT SYS_C0015675 PRIMARY KEY (SIGN_IN_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table TASK_SIGN_IN
-- ----------------------------
ALTER TABLE WORKORDER.TASK_SIGN_IN ADD CONSTRAINT SYS_C0015674 CHECK (SIGN_IN_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_SIGN_IN ADD CONSTRAINT SYS_C0028328 CHECK (SIGN_IN_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_SIGN_IN ADD CONSTRAINT SYS_C0028630 CHECK (SIGN_IN_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table TASK_TIME_OUT_RECORD
-- ----------------------------
ALTER TABLE WORKORDER.TASK_TIME_OUT_RECORD ADD CONSTRAINT SYS_C0015677 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table TASK_TIME_OUT_RECORD
-- ----------------------------
ALTER TABLE WORKORDER.TASK_TIME_OUT_RECORD ADD CONSTRAINT SYS_C0015676 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_TIME_OUT_RECORD ADD CONSTRAINT SYS_C0028329 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.TASK_TIME_OUT_RECORD ADD CONSTRAINT SYS_C0028631 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER ADD CONSTRAINT SYS_C0015680 PRIMARY KEY (ORDER_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER ADD CONSTRAINT CUSTOM_FIELD_JOSN CHECK (custom_field is json) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER ADD CONSTRAINT SYS_C0015678 CHECK (ORDER_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER ADD CONSTRAINT SYS_C0028330 CHECK (ORDER_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER ADD CONSTRAINT SYS_C0028632 CHECK (ORDER_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_FIELD_REFLECT
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_FIELD_REFLECT ADD CONSTRAINT SYS_C0015682 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_FIELD_REFLECT
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_FIELD_REFLECT ADD CONSTRAINT SYS_C0015681 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FIELD_REFLECT ADD CONSTRAINT SYS_C0028331 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FIELD_REFLECT ADD CONSTRAINT SYS_C0028633 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_FILTER_MENU
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT SYS_C0018270 PRIMARY KEY (PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_FILTER_MENU
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT FILTER_CONDITION_JSON CHECK (filter_condition is json) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT SYS_C0018267 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT SYS_C0018268 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT SYS_C0028332 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT SYS_C0028333 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT SYS_C0028634 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_FILTER_MENU ADD CONSTRAINT SYS_C0028635 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_HEAD_FIELD
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_HEAD_FIELD ADD CONSTRAINT SYS_C0015688 PRIMARY KEY (ORDER_HEAD_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_HEAD_FIELD
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_HEAD_FIELD ADD CONSTRAINT SYS_C0015687 CHECK (ORDER_HEAD_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_HEAD_FIELD ADD CONSTRAINT SYS_C0028334 CHECK (ORDER_HEAD_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_HEAD_FIELD ADD CONSTRAINT SYS_C0028636 CHECK (ORDER_HEAD_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_LOG
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_LOG ADD CONSTRAINT SYS_C0015691 PRIMARY KEY (LOG_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_LOG
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_LOG ADD CONSTRAINT NODE_MODEL_VALUE_JSON CHECK (node_model_value is json) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_LOG ADD CONSTRAINT SYS_C0015689 CHECK (LOG_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_LOG ADD CONSTRAINT SYS_C0028335 CHECK (LOG_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_LOG ADD CONSTRAINT SYS_C0028637 CHECK (LOG_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_RELATION
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_RELATION ADD CONSTRAINT SYS_C0015693 PRIMARY KEY (ORDER_RELATION_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_RELATION
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_RELATION ADD CONSTRAINT SYS_C0015692 CHECK (ORDER_RELATION_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_RELATION ADD CONSTRAINT SYS_C0028336 CHECK (ORDER_RELATION_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_RELATION ADD CONSTRAINT SYS_C0028638 CHECK (ORDER_RELATION_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_STATUS
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_STATUS ADD CONSTRAINT SYS_C0015696 PRIMARY KEY (PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_STATUS
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_STATUS ADD CONSTRAINT SYS_C0015694 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_STATUS ADD CONSTRAINT SYS_C0015695 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_STATUS ADD CONSTRAINT SYS_C0028337 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_STATUS ADD CONSTRAINT SYS_C0028338 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_STATUS ADD CONSTRAINT SYS_C0028639 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_STATUS ADD CONSTRAINT SYS_C0028640 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_TRIGGER_INFO
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_INFO ADD CONSTRAINT SYS_C0015700 PRIMARY KEY (TRIGGER_INFO_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_TRIGGER_INFO
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_INFO ADD CONSTRAINT SYS_C0015697 CHECK (TRIGGER_INFO_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_INFO ADD CONSTRAINT SYS_C0028339 CHECK (TRIGGER_INFO_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_INFO ADD CONSTRAINT SYS_C0028641 CHECK (TRIGGER_INFO_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_TRIGGER_RELATION
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_RELATION ADD CONSTRAINT SYS_C0015702 PRIMARY KEY (TRIGGER_RELATION_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_TRIGGER_RELATION
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_RELATION ADD CONSTRAINT SYS_C0015701 CHECK (TRIGGER_RELATION_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_RELATION ADD CONSTRAINT SYS_C0028340 CHECK (TRIGGER_RELATION_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TRIGGER_RELATION ADD CONSTRAINT SYS_C0028642 CHECK (TRIGGER_RELATION_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_TYPE
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TYPE ADD CONSTRAINT SYS_C0015705 PRIMARY KEY (TYPE_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_TYPE
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TYPE ADD CONSTRAINT SYS_C0015703 CHECK (TYPE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TYPE ADD CONSTRAINT SYS_C0028341 CHECK (TYPE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TYPE ADD CONSTRAINT SYS_C0028643 CHECK (TYPE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_TYPE_MENU
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_MENU ADD CONSTRAINT SYS_C0015707 PRIMARY KEY (PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_TYPE_MENU
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_MENU ADD CONSTRAINT SYS_C0015706 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_MENU ADD CONSTRAINT SYS_C0028342 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_MENU ADD CONSTRAINT SYS_C0028644 CHECK (PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_TYPE_NODE
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_NODE ADD CONSTRAINT SYS_C0015711 PRIMARY KEY (NODE_PRIMARY_ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_TYPE_NODE
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_NODE ADD CONSTRAINT SYS_C0015708 CHECK (NODE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_NODE ADD CONSTRAINT SYS_C0028343 CHECK (NODE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_TYPE_NODE ADD CONSTRAINT SYS_C0028645 CHECK (NODE_PRIMARY_ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;

-- ----------------------------
-- Primary Key structure for table WORK_ORDER_URGE
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_URGE ADD CONSTRAINT SYS_C0015713 PRIMARY KEY (ID);

-- ----------------------------
-- Checks structure for table WORK_ORDER_URGE
-- ----------------------------
ALTER TABLE WORKORDER.WORK_ORDER_URGE ADD CONSTRAINT SYS_C0015712 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_URGE ADD CONSTRAINT SYS_C0028344 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
ALTER TABLE WORKORDER.WORK_ORDER_URGE ADD CONSTRAINT SYS_C0028646 CHECK (ID IS NOT NULL) NOT DEFERRABLE INITIALLY IMMEDIATE NORELY VALIDATE;
